package com.gyg.enums;

/**
 * 操作类型枚举
 */
public enum FileOperateEnum {

    UPLOAD(1, "上传"),
    DOWNLOAD(2, "下载");

    private Integer code;
    private String desc;

    FileOperateEnum (Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static FileOperateEnum getInstance(Integer code) {
        for (FileOperateEnum item : FileOperateEnum.values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }
}
